; Fix documentation of 'find-file-noselect'
authorEli Zaretskii <eliz@gnu.org>
Sat, 2 Aug 2025 14:33:15 +0000 (17:33 +0300)
committerEli Zaretskii <eliz@gnu.org>
Sat, 2 Aug 2025 14:33:15 +0000 (17:33 +0300)
* doc/lispref/files.texi (Visiting Functions):
* lisp/files.el (find-file-noselect): Document that NOWARN non-nil
also bypasses the file's last change verification.  (Bug#79127)

doc/lispref/files.texi
lisp/files.el

index c285cd1c683f86bff9daa4f7a6f59760b3fe8f22..d69bc46cd2ce4f8b13674f6eb88740ff902306cb 100644 (file)
@@ -149,9 +149,10 @@ The function returns an existing buffer if there is one; otherwise it
 creates a new buffer and reads the file into it.  When
 @code{find-file-noselect} uses an existing buffer, it first verifies
 that the file has not changed since it was last visited or saved in
-that buffer.  If the file has changed, this function asks the user
-whether to reread the changed file.  If the user says @samp{yes}, any
-edits previously made in the buffer are lost.
+that buffer (unless @var{nowarn} is non-@code{nil}, see below).  If the
+file has changed, this function asks the user whether to reread the
+changed file.  If the user says @samp{yes}, any edits previously made in
+the buffer are lost.
 
 Reading the file involves decoding the file's contents (@pxref{Coding
 Systems}), including end-of-line conversion, and format conversion
@@ -163,7 +164,8 @@ This function displays warning or advisory messages in various peculiar
 cases, unless the optional argument @var{nowarn} is non-@code{nil}.  For
 example, if it needs to create a buffer, and there is no file named
 @var{filename}, it displays the message @samp{(New file)} in the echo
-area, and leaves the buffer empty.
+area, and leaves the buffer empty.  The verification of the file's last
+change is also bypassed if @var{nowarn} is non-@code{nil}.
 
 The @code{find-file-noselect} function normally calls
 @code{after-find-file} after reading the file (@pxref{Subroutines of
index c288a5a8b265f5ba4b3aa4b984b1afb46c6de00a..6544ee54ee47a8d0d209b159c3f7edcb58e5525b 100644 (file)
@@ -2502,7 +2502,9 @@ be visible in the echo area."
 If a buffer exists visiting FILENAME, return that one, but
 verify that the file has not changed since visited or saved.
 The buffer is not selected, just returned to the caller.
-Optional second arg NOWARN non-nil means suppress any warning messages.
+Optional second arg NOWARN non-nil means suppress any warning messages,
+and also don't verify the that the file has not been changed since
+last visited or saved.
 Optional third arg RAWFILE non-nil means the file is read literally.
 Optional fourth arg WILDCARDS non-nil means do wildcard processing
 and visit all the matching files.  When wildcards are actually